#ifndef QQ_NAVIGATION_BAR
#define QQ_NAVIGATION_BAR

#include <qwidget.h>
#include <qlayout.h>

#include <Def.h>
#include <stdafx.h>
#include <ElaInteractiveCard.h>
#include <ElaIconButton.h>

#include "QQNavigationModel.h"
#include "QQNavigationView.h"
#include "QQNavigationDelegate.h"

class QQNavigationBar : public QWidget
{
	Q_OBJECT
public:
	explicit QQNavigationBar(QWidget* parent = nullptr);
	~QQNavigationBar();

	void setUserInfoCardVisible(bool isVisible);
	void setUserInfoCardPixmap(QPixmap pixmap);
	void setUserInfoCardSize(QSize size);

	void setNavigationIconSize(QSize size);

	void setFooterIconSize(QSize size);

	QString addPageNode(QWidget* page, QIcon icon = QIcon());
	QString addPageNode(QWidget* page, int keyPoints = 0, QIcon icon = QIcon());
	QString addFooterNode(int keyPoints = 0, QIcon icon = QIcon());
	QString addFooterNode(QWidget* page, int keyPoints = 0, QIcon icon = QIcon());

	void setNodeKeyPoints(QString nodeKey, int keyPoints);
	int getNodeKeyPoints(QString nodeKey) const;

	void onNavigationViewClicked(const QModelIndex& index);
	void onFooterViewClicked(const QModelIndex& index);

signals:
	void userInfoCardClicked();
	void navigationNodeClicked(QString nodeKey);
private:
	ElaIconButton* mUserButton;
	QQNavigationModel* mNavigationModel;
	QQNavigationView* mNavigationView;
	QQNavigationDelegate* mNavigationDelegate;
	QQNavigationModel* mFooterModel;
	QQNavigationView* mFooterView;
	QQNavigationDelegate* mFooterDelegate;
};

#endif // QQ_NAVIGATION_BAR
